<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
    var ctx = "${ctx}";
</script>
<c:set var="projectName" value="星级认证管理系统"/>


<script src="${ctx}/js/easyui/jquery/jquery-1.11.1.js" type="text/javascript"></script>

<link type='text/css' rel='stylesheet' href='${ctx}/css/normal.css'/>
<link type='text/css' rel='stylesheet' href='${ctx}/js/artDialog/skins/blue.css'/>
<script type='text/javascript' src='${ctx}/js/artDialog/artDialog.source.js'></script>
<script type='text/javascript' src='${ctx}/js/artDialog/iframeTools.source.js'></script>

<script type='text/javascript' src='${ctx}/js/normalutil.js'></script>
<%--<script type='text/javascript' src='${ctx}/js/pageToservice.js'></script>--%>

<script type='text/javascript' src='${ctx}/js/cookie.js'></script>

<link type='text/css' rel='stylesheet' href='${ctx}/css/demo_tip.css'/>
<link type='text/css' rel='stylesheet' href='${ctx}/css/formstyle.css'/>
<%--<script type="text/javascript" src="${ctx}/js/jquery-1.9.1.min.js"></script>--%>

<script type='text/javascript' src='${ctx}/js/formjs.js'></script>
<script type='text/javascript' src='${ctx}/js/tipalert/alertWin.js'></script>
<link type='text/css' rel='stylesheet' href='${ctx}/js/tipalert/alertwin.css'/>
<script type='text/javascript' src='${ctx}/js/managegrid.js'></script>

<!-- 左右分栏效果 -->
<script type='text/javascript' src='${ctx}/js/split/splitter.js'></script>
<link type='text/css' rel='stylesheet' href='${ctx}/js/split/style.css'/>
<script type='text/javascript' src='${ctx}/js/contextmenu.js'></script>
<script type='text/javascript' src='${ctx}/js/jcarousellite.js'></script>

<!-- easyui皮肤 -->
<link href="${ctx}/js/easyui/jquery-easyui-theme/<c:out value="${cookie.themeName.value}" default="default"/>/easyui.css"
      rel="stylesheet" type="text/css"/>
<link href="${ctx}/js/easyui/jquery-easyui-theme/icon.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/js/easyui/icons/icon-all.css" rel="stylesheet" type="text/css"/>


<script src="${ctx}/js/easyui/jquery-easyui-1.3.6/jquery.easyui.min.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<%--<script src="${ctx}/js/easyui/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>--%>

<!-- jquery扩展 -->
<script src="${ctx}/js/easyui/release/jquery.jdirk.min.js"></script>

<!-- easyui扩展 -->
<link href="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.css" rel="stylesheet" type="text/css"/>

<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.progressbar.js"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.slider.js"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.linkbutton.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.validatebox.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.combo.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.combobox.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.menu.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.searchbox.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.panel.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.window.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.dialog.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.layout.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.tree.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.datagrid.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.treegrid.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.combogrid.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.combotree.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.tabs.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.theme.js" type="text/javascript"></script>

<script src="${ctx}/js/easyui/icons/jeasyui.icons.all.js" type="text/javascript"></script>


<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.icons.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.gridselector.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/plugins/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

<script src="${ctx}/js/easyui/jeasyui-extensions/jquery.toolbar.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jquery.comboicons.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jquery.comboselector.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jquery.portal.js" type="text/javascript"></script>
<script src="${ctx}/js/easyui/jeasyui-extensions/jquery.my97.js" type="text/javascript"></script>


<script src="${ctx}/js/easyui/jeasyui-extensions/jeasyui.extensions.ty.js"></script>

<script type="text/javascript" src="${ctx}/js/jquery.tips.js"></script>


<script type="text/javascript" src="${ctx}/js/ckeditor/ckeditor.js"></script>


<%--<script type='text/javascript'>--%>
    <%--Sys.setProjectPath('${ctx}');--%>
    <%--formStylePath.setImagePath('${ctx}/images/');--%>
<%--</script>--%>
<script type="text/javascript" src="${ctx}/js/regionSelect.js"></script>
<script type="text/javascript">

    function reloadlogin() {
        window.top.location.href = "${ctx}/login"
    }
    
    function print() {
        document.execCommand('Print');
    }
    
    //创建查询对象并查询
    function cx() {
        var obj = $("#searchForm").serializeObject();
        $("#dg").datagrid('reload', obj);
    }
    
    function collpase() {
        $("#dg").datagrid('resize');
    }
    
    function getSelectionsId() {
		var pks = $("#dg").datagrid("getSelections");
		if (pks.length == 0) { 
			$.messager.alert('警告','请选择将要删除的数据！');
			return false; 
		}
		var ids = [];
	    for (var i = 0; i < pks.length; i++) {
	        ids.push(pks[i].id);
	    }
	    return ids;
	}
    
    /**
     * ajax返回提示
     * @param data	返回的数据
     * @param dg datagrid
     * @param d	弹窗
     * @returns {Boolean} ajax是否成功
     */
    function successTip(data,dg,d){
    	if(data=='success'){
    		if(dg!=null)
    			dg.datagrid('reload');
    		if(d!=null)
    			d.panel('close');
    		parent.$.messager.show({ title : "提示",msg: "操作成功！", position: "bottomRight" });
    		return true;
    	}else{
    		parent.$.messager.alert('警告',data);
    		return false;
    	}  
    }
    
    $.extend($.fn.validatebox.defaults.rules, {
        CHS: {
            validator: function(value, param) {
                return /^[\u0391-\uFFE5]+$/.test(value);
            },
            message: '请输入汉字'
        },
        english: { // 验证英语
            validator: function(value) {
                return /^[A-Za-z]+$/i.test(value);
            },
            message: '请输入英文'
        },
        ip: { // 验证IP地址
            validator: function(value) {
                return /\d+\.\d+\.\d+\.\d+/.test(value);
            },
            message: 'IP地址格式不正确'
        },
        ZIP: {
            validator: function(value, param) {
                return /^[0-9]\d{5}$/.test(value);
            },
            message: '邮政编码不存在'
        },
        QQ: {
            validator: function(value, param) {
                return /^[1-9]\d{4,10}$/.test(value);
            },
            message: 'QQ号码不正确'
        },
        mobile: {
            validator: function(value, param) {
                return /^(?:13\d|15\d|18\d)-?\d{5}(\d{3}|\*{3})$/.test(value);
            },
            message: '手机号码不正确'
        },
        tel: {
            validator: function(value, param) {
                return /^(\d{3}-|\d{4}-)?(\d{8}|\d{7})?(-\d{1,6})?$/.test(value);
            },
            message: '电话号码不正确'
        },
        mobileAndTel: {
            validator: function(value, param) {
                return /(^([0\+]\d{2,3})\d{3,4}\-\d{3,8}$)|(^([0\+]\d{2,3})\d{3,4}\d{3,8}$)|(^([0\+]\d{2,3}){0,1}13\d{9}$)|(^\d{3,4}\d{3,8}$)|(^\d{3,4}\-\d{3,8}$)/.test(value);
            },
            message: '请正确输入电话号码'
        },
        number: {
            validator: function(value, param) {
                return /^[0-9]+.?[0-9]*$/.test(value);
            },
            message: '请输入数字'
        },
        money: {
            validator: function(value, param) {
                return (/^(([1-9]\d*)|\d)(\.\d{1,2})?$/).test(value);
            },
            message: '请输入正确的金额'

        },
        mone: {
            validator: function(value, param) {
                return (/^(([1-9]\d*)|\d)(\.\d{1,2})?$/).test(value);
            },
            message: '请输入整数或小数'

        },
        integer: {
            validator: function(value, param) {
                return /^[+]?[1-9]\d*$/.test(value);
            },
            message: '请输入最小为1的整数'
        },
        integ: {
            validator: function(value, param) {
                return /^[+]?[0-9]\d*$/.test(value);
            },
            message: '请输入整数'
        },
        range: {
            validator: function(value, param) {
                if (/^[1-9]\d*$/.test(value)) {
                    return value >= param[0] && value <= param[1]
                } else {
                    return false;
                }
            },
            message: '输入的数字在{0}到{1}之间'
        },
        minLength: {
            validator: function(value, param) {
                return value.length >= param[0]
            },
            message: '至少输入{0}个字'
        },
        maxLength: {
            validator: function(value, param) {
                return value.length <= param[0]
            },
            message: '最多{0}个字'
        },
        //select即选择框的验证
        selectValid: {
            validator: function(value, param) {
                if (value == param[0]) {
                    return false;
                } else {
                    return true;
                }
            },
            message: '请选择'
        },
        idCode: {
            validator: function(value, param) {
                return /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(value);
            },
            message: '请输入正确的身份证号'
        },
        loginName: {
            validator: function(value, param) {
                return /^[\u0391-\uFFE5\w]+$/.test(value);
            },
            message: '登录名称只允许汉字、英文字母、数字及下划线。'
        },
        equalTo: {
            validator: function(value, param) {
                return value == $(param[0]).val();
            },
            message: '两次输入的字符不一至'
        },
        englishOrNum: { // 只能输入英文和数字
            validator: function(value) {
                return /^[a-zA-Z0-9_ ]{1,}$/.test(value);
            },
            message: '请输入英文、数字、下划线或者空格'
        },
        xiaoshu: {
            validator: function(value) {
                return /^(([1-9]+)|([0-9]+\.[0-9]{1,2}))$/.test(value);
            },
            message: '最多保留两位小数！'
        },
        ddPrice: {
            validator: function(value, param) {
                if (/^[1-9]\d*$/.test(value)) {
                    return value >= param[0] && value <= param[1];
                } else {
                    return false;
                }
            },
            message: '请输入1到100之间正整数'
        },
        jretailUpperLimit: {
            validator: function(value, param) {
                if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
                    return parseFloat(value) > parseFloat(param[0]) && parseFloat(value) <= parseFloat(param[1]);
                } else {
                    return false;
                }
            },
            message: '请输入0到100之间的最多俩位小数的数字'
        },
        rateCheck: {
            validator: function(value, param) {
                if (/^[0-9]+([.]{1}[0-9]{1,2})?$/.test(value)) {
                    return parseFloat(value) > parseFloat(param[0]) && parseFloat(value) <= parseFloat(param[1]);
                } else {
                    return false;
                }
            },
            message: '请输入0到1000之间的最多俩位小数的数字'
        },
        requireRadio: {  
            validator: function(value, param){  
                var input = $(param[0]);
                input.off('.requireRadio').on('click.requireRadio',function(){
                    $(this).focus();
                });
                return $(param[0] + ':checked').val() != undefined;
            },  
            message: '请至少选择一个{1}.'  
        }  
    });
</script>
